<#include "copyright.ftl"/>
package ${basePackage}.${moduleName}.dao;
 
import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import java.util.List;
import ${basePackage}.${moduleName}.entity.${table.className};

/**
 * User:
 * Date: ${.now}
 */
public abstract class ${table.className}DAO extends ctd.persistence.support.hibernate.HibernateSupportDelegateDAO<${table.className}> {

    public ${table.className}DAO() {
        <#list table.primaryKeys as key>
        this.setKeyField("${key.javaProperty}");
        </#list>        
    }

    @DAOMethod(sql = "from ${table.className} where <#list table.primaryKeys as key>${key.javaProperty}=:${key.javaProperty}</#list>")
    public abstract ${table.className} get${table.className}ById(<#list table.primaryKeys as key>@DAOParam("${key.javaProperty}") String ${key.javaProperty}</#list>);

    @DAOMethod(sql = "from ${table.className}")
    public abstract List<${table.className}> find${table.className}s();

}